/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 登录页面样式 */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.test-accounts {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9rem;
}

.test-accounts h3 {
    margin-bottom: 0.5rem;
    color: #666;
}

/* 主布局样式 */
.container {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main";
    grid-template-rows: 60px 1fr;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.header {
    grid-area: header;
    background: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.header h1 {
    font-size: 1.5rem;
}

.user-info {
    color: #ecf0f1;
}

.user-info a {
    color: #3498db;
    text-decoration: none;
}

.sidebar {
    grid-area: sidebar;
    background: #34495e;
    color: white;
    padding: 1rem 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar li a {
    display: block;
    padding: 1rem 2rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar li a:hover,
.sidebar li a.active {
    background: #2c3e50;
    color: white;
    border-left: 4px solid #3498db;
}

.main-content {
    grid-area: main;
    padding: 2rem;
    background: #ecf0f1;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #2c3e50;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* 表单样式 */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.search-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem;
}

/* 警告框 */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #bdc3c7;
    text-decoration: none;
    color: #3498db;
    border-radius: 4px;
}

.pagination a:hover {
    background: #3498db;
    color: white;
}

.pagination .current-page {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 仪表板样式 */
.dashboard h2 {
    margin-bottom: 2rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

/* 详情页面样式 */
.detail-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.detail-card {
    padding: 2rem;
}

.detail-card h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.detail-item label {
    font-weight: 600;
    color: #7f8c8d;
}

.detail-item span {
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-areas:
            "header"
            "main";
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .actions {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }
}